'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add altering commands here.
     *
     * Example:
     * await queryInterface.createTable('users', { id: Sequelize.INTEGER });
     */
    const { INTEGER, STRING, DATE } = Sequelize;
    await queryInterface.createTable("sys_role_dept", {
      role_id: {
        type:INTEGER(20),
        comment:"角色ID",
        allowNull:false
      },
      dept_id: {
        type: INTEGER(20),
        allowNull: false,
        comment: "部门ID"
      },
      created_at: {
        type: DATE,
        comment: "创建时间",
      },
      updated_at: {
        type: DATE,
        comment: "更新时间",
      },
      deleted_at: {
        type: DATE,
        comment: "删除时间",
      }
    });
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add reverting commands here.
     *
     * Example:
     * await queryInterface.dropTable('users');
     */
    await queryInterface.dropTable('sys_role_dept');
  }
};
